Strict forwarding pt.2#1244
Merged
GeorgeTsagk merged 3 commits intolightninglabs:mainfrom Dec 13, 2024
Merged
Conversation
Member
Author
|
Will add some Litd itest coverage too |
Pull Request Test Coverage Report for Build 12313714722Details
💛 - Coveralls |
2 tasks
b3abdb1 to
7a8eb9f
Compare
guggero
approved these changes
Dec 11, 2024
Member
|
We'll merge this after the |
Previously we had strict-forwarding protection placed in the AuxInvoiceManager, but that would only protect asset invoices against pure-btc HTLCs. This commit adds the inverse complementary check which prevents settling the invoice if btc ras requested but assets were offered.
In this commit we add an extra test case that checks if the AuxInvoiceManager will reject the asset HTLCs that pay to a btc invoice. We also do some housekeeping (commonly used vars, comments) across the other test cases.
In this commit we extend the property based tests to account for the new piece of AuxInvoiceManager behavior. If the randomly generated invoice is not an asset invoice, but the HTLCs do carry assets, we should expect the manager to reject the HTLCs.
7a8eb9f to
ffc6e68
Compare
Member
Author
|
Since this is breaking the current expected behavior from LitD itests, we are not going to see a green Refer to the respective LitD PR for the correct state of the itests |
Member
Author
|
LitD itests are green, merging this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In a previous PR we added strict forwarding support, meaning that an invoice that asks for asset X may only be settled if the HTLCs are carrying asset X. We did not think of strict forwarding protection for btc invoices being paid for with asset HTLCs.
Solution
In this PR we extend the
AuxInvoiceManagerwith an extra check, which cancels the HTLCs that are paying to this invoice if the invoice is a btc invoice, but the HTLCs are carrying assets.Related Issues
Closes #1239